This invention relates to cards having magnetic or electronic data storage (xe2x80x9cSmartcardsxe2x80x9d) capability and in particular to interfaces between such cards and an application specific programmed controller.
Smartcards and smartcard readers are disclosed in patents to Innovatron and Bull CP. See for example U.S. Pat. Nos. 4,102,493 and 4,404,464. Smartcards generally conform to one or more parts of ISO standard 7816.
Several prior art smartcard reader/writers use a programmed microprocessor to perform a series of predetermined actions on a smartcard under control of an external control system. The external control system must have xe2x80x9cfull knowledgexe2x80x9d of the smartcard being used. Any changes to the cards being used must be reflected in changes to the external control system. The designer or user of the external control system must have an extensive understanding of the smartcards for which the reader/writer is intended.
Several other prior art smartcard reader/writers incorporate a programmed microprocessor to perform all actions on a smartcard autonomously. These reader/writers typically form a completed product, i.e. vending machine or point-of-sale terminal. Alteration of the product to support new or different smartcards requires a redesign or modification of the fundamental reader/writer component. This restricts the ability of an original equipment manufacturer to incorporate smartcard technology in traditional products.
Existing smartcard reader/writers fall into two categories. The first is that which acts as card coupler. A card coupler only provides the hardware and minimum necessary software to read from, or write to, a smartcard. The coupler may support a range of cards, possibly from more than one card manufacturer. However, this support is, because the final use is unknown, largely confined to the simplest and most generalised tasks. The coupler is commonly used as a development tool for entry into the smartcard field, or as a means of adding smartcard capability to existing product designs. In either case, the user of the coupler must gain or possess a good knowledge of the smartcard, the card data structures, and data transfer procedures.
The other extreme is that of an application or product with imbedded smartcard capability. The reader is an intrinsic part of the host control system. Support is limited to a few card types, with data contents, structures, security and transfer procedures predetermined by the equipment manufacturer.
There is currently no easy way for smartcard capability to be added to a manufacturers product or for azn existing card reader to be altered to handle new smart card types, short of that manufacturer becoming an expert in the smartcard field. Should a competitor proceed down this path, the delay in recovering to a competitive position would be costly and time consuming. Furthermore there is currently no card reader available which can read a variety of types of magnetic cards as well as a variety of types of chip cards.
It is therefore an object of the present invention to provide an interface for use between cards having magnetic or electronic data storage capability and an application specific program controller that at least goes some way toward overcoming the above disadvantages.
In a first aspect the invention consists in a card reader/writer which interfaces a host application program with a data storage card characterised in that:
said card reader/writer can respond to said application program using at least one designated high level language,
a plurality of low level protocol sets are stored which each correspond to a known data storage card type,
said card reader is able to establish the card type for any card interfaced to it for which it has a protocol set, and select from its store of protocols the appropriate low level protocol for the established card type,
said card reader/writer reads and translates high level language commands from the host program to corresponding commands within said established low level protocol and writes these low level commands to said card,
and said card reader/writer reads commands in said established low level protocol from said card translates them to a corresponding command in said high level language and writes these commands to said host application program.
In a second aspect the invention consists in a method of interfacing a host application program with a data storage card comprising the steps of:
establishing the card type,
selecting from a store of protocols the appropriate low level protocol for the established card type,
reading high level language commands from the host program,
translating said read high level language commands to corresponding commands within said established low level protocol,
writing said corresponding commands to said card,
reading commands in said established low level protocol from said card,
translating said low level protocol commands into corresponding commands from said high level language, and
writing said corresponding commands from said high level language to said host application program.
In a third aspect the invention consists in a method of enabling a controller to read and write data via a card read/write station to a plurality of known types of card devices incorporating magnetic or electronic data storage means, which method uses a stored-program stored-data processor, said method comprising: storing first data arrays containing strings of known card characterising data and for each string its corresponding card identifier, storing second data arrays containing card identifiers and for each identifier its corresponding command strings, and executing a program on said processor which causes said processor to:
(1) detect the presence of a card in said read/write station and to pass a card detect signal to said controller,
(2) read the data string which characterises the card,
(3) search through at least one said first array for a matching data string, and upon making a successful match to retrieve the corresponding card identifier,
(4) select the appropriate command strings in said second array using the retrieved card identifier,
(5) accept generic transaction instructions from said controller,
(6) translate the instructions from said controller to commands appropriate to the inserted card using the selected command strings from the second array, and
(7) either read or write data to said card in accordance with said generic instructions.
In a fourth aspect the invention consists in a universal card interface for interfacing smartcards and other card devices having electronic or magnetic data storage with a controller requiring read/write access to said cards comprising:
a card read/write station into which cards may be inserted for data transfer, a processor having associated memory and input-output ports,
said read/write station connected to one input-output port and said controller connected to a second input-output port,
interface software and data arrays stored in said memory,
said data arrays including first and second data arrays with said first data arrays containing strings of known card characterising data and for each string its corresponding card identifier, said second data arrays containing card identifiers and for each identifier its corresponding command strings, said software when executed by said processor causing said processor to:
(1) detect the presence of a card in said read/write station and to pass a card detect signal to said controller,
(2) read the data string which characterises the card,
(3) search through at least one said first array for a matching data string, and upon making a successful match to retrieve the corresponding card identifier,
(4) select the appropriate command strings in said second array using the retrieved card identifier,
(5) accept generic transaction instructions from said controller,
(6) translate the instructions from said controller to commands appropriate to the inserted card using the selected command strings from the second array, and
(7) either read or write data to said card in accordance with said generic instructions.
In a fifth aspect the invention consists in a method of enabling application software to interface with any known type of smartcard or other card devices having electronic or magnetic data storage, comprising:
(1) reading from the card to be interfaced the data string which characterises that card,
(2) searching through a first data array containing strings of known card characterising data, and for each string its corresponding card identifier, for a matching data string, and upon making a successful match retrieving the corresponding card identifier,
(3) selecting the appropriate command strings from a second data array containing card identifiers, and for each identifier its corresponding command strings, using the retrieved card identifier,
(4) accepting generic transaction instructions from said application software,
(5) translating the instructions from said application software to low level commands appropriate to the card being interfaced using the selected command strings from said second data array, and
(6) causing data to be either read from or written to said card in accordance with said generic instructions.
In a sixth aspect the invention consists in a software algorithm which enables application software to interface with any known type of smartcard or other card devices having electronic or magnetic data storage, comprising a hierarchy of functional modules wherein:
a first level module reads from the card to be interfaced the data string which characterises that card and passes said data string to a second level module,
the second level module searches through a first data array containing strings of known card characterising data, and for each string its corresponding card identifier, for a matching data string, and upon making a successful match retrieves the corresponding card identifier and passes said card identifier to a third level module,
the third level module selects the appropriate command strings from a second data array containing card identifiers, and for each identifier its corresponding command strings, using the card identifier passed to it,
a fifth level module accepts generic transaction instructions from said application software and passes those instructions to a fourth level module,
the fourth level module translates the instructions from said fourth level module to low level commands appropriate to the card being interfaced using the command strings selected by the third level module, and
the first level module either reads from or writes to said card in accordance with the translated generic instructions passed from the fourth level module.
The universal card interface of the present invention is able to recognise any ISO card type presented to it, communicate with the card using the protocols appropriate to that card type, and communicate with the host application program using a high level command language.